<template>
  <div>
    <ToolTip :content="getUser()" />
  </div>
</template>

<script>
export default {
  props: {
    user: {
      type: String | Object,
      default: ''
    }
  },
  methods: {
    getUser() {
      const user = this.user;
      if (!user) return '--';
      if (typeof user === 'string') {
        return user;
      }
      let userName = user.userName;
      if (user.jobNumber) userName += `(${user.jobNumber})`;
      return userName;
    }
  }
};
</script>

<style lang="scss" scoped>

</style>
